/**
 * Created by terry on 2017/10/18.
 */
package com.jims.api.v1.controller;

import com.jims.master.common.data.Message;
import com.jims.master.common.utils.CacheUtils;
import com.jims.master.common.utils.SecurityUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/test")
public class DemoController {


//    private static final Logger LOG = LoggerFactory.getLogger(DemoController.class);

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    public String test1() throws Exception
    {

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("111","");
        map.put("222","发的");
        map.put("333","asdasd");
        map.put("444",new Date());
        map.put("555",null);

        Message mes = new Message();
        mes.setData(map);
        return SecurityUtil.encryptMsgData(mes);
    }


    @RequestMapping(value = "/test2", method = RequestMethod.GET)
    public String test2() throws Exception
    {
        throw new Exception();
    }


}